home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / fratboy_.swf / scripts / __Packages / mx / skins / halo / RectBorder.as < prev   
Text File  |  2010-11-09  |  7KB  |  179 lines

  1. class mx.skins.halo.RectBorder extends mx.skins.RectBorder
  2. {
  3.    static var symbolName = "RectBorder";
  4.    static var symbolOwner = mx.skins.halo.RectBorder;
  5.    static var version = "2.0.2.126";
  6.    var borderCapColorName = "borderCapColor";
  7.    var shadowCapColorName = "shadowCapColor";
  8.    var colorList = {highlightColor:0,borderColor:0,buttonColor:0,shadowColor:0,borderCapColor:0,shadowCapColor:0};
  9.    var borderWidths = {none:0,solid:1,inset:2,outset:2,alert:3,dropDown:2,menuBorder:2,comboNonEdit:2};
  10.    static var classConstructed = mx.skins.halo.RectBorder.classConstruct();
  11.    static var UIObjectExtensionsDependency = mx.core.ext.UIObjectExtensions;
  12.    function RectBorder()
  13.    {
  14.       super();
  15.    }
  16.    function init(Void)
  17.    {
  18.       this.borderWidths["default"] = 3;
  19.       super.init();
  20.    }
  21.    function getBorderMetrics(Void)
  22.    {
  23.       if(this.offset == undefined)
  24.       {
  25.          var _loc3_ = this.getStyle(this.borderStyleName);
  26.          this.offset = this.borderWidths[_loc3_];
  27.       }
  28.       if(this.getStyle(this.borderStyleName) == "default" || this.getStyle(this.borderStyleName) == "alert")
  29.       {
  30.          this.__borderMetrics = {left:3,top:1,right:3,bottom:3};
  31.          return this.__borderMetrics;
  32.       }
  33.       return super.getBorderMetrics();
  34.    }
  35.    function drawBorder(Void)
  36.    {
  37.       var _loc6_ = _global.styles[this.className];
  38.       if(_loc6_ == undefined)
  39.       {
  40.          _loc6_ = _global.styles.RectBorder;
  41.       }
  42.       var _loc5_ = this.getStyle(this.borderStyleName);
  43.       var _loc7_ = this.getStyle(this.borderColorName);
  44.       if(_loc7_ == undefined)
  45.       {
  46.          _loc7_ = _loc6_[this.borderColorName];
  47.       }
  48.       var _loc8_ = this.getStyle(this.backgroundColorName);
  49.       if(_loc8_ == undefined)
  50.       {
  51.          _loc8_ = _loc6_[this.backgroundColorName];
  52.       }
  53.       var _loc16_ = this.getStyle("backgroundImage");
  54.       if(_loc5_ != "none")
  55.       {
  56.          var _loc14_ = this.getStyle(this.shadowColorName);
  57.          if(_loc14_ == undefined)
  58.          {
  59.             _loc14_ = _loc6_[this.shadowColorName];
  60.          }
  61.          var _loc13_ = this.getStyle(this.highlightColorName);
  62.          if(_loc13_ == undefined)
  63.          {
  64.             _loc13_ = _loc6_[this.highlightColorName];
  65.          }
  66.          var _loc12_ = this.getStyle(this.buttonColorName);
  67.          if(_loc12_ == undefined)
  68.          {
  69.             _loc12_ = _loc6_[this.buttonColorName];
  70.          }
  71.          var _loc11_ = this.getStyle(this.borderCapColorName);
  72.          if(_loc11_ == undefined)
  73.          {
  74.             _loc11_ = _loc6_[this.borderCapColorName];
  75.          }
  76.          var _loc10_ = this.getStyle(this.shadowCapColorName);
  77.          if(_loc10_ == undefined)
  78.          {
  79.             _loc10_ = _loc6_[this.shadowCapColorName];
  80.          }
  81.       }
  82.       this.offset = this.borderWidths[_loc5_];
  83.       var _loc9_ = this.offset;
  84.       var _loc3_ = this.__get__width();
  85.       var _loc4_ = this.__get__height();
  86.       this.clear();
  87.       this._color = undefined;
  88.       if(_loc5_ != "none")
  89.       {
  90.          if(_loc5_ == "inset")
  91.          {
  92.             this._color = this.colorList;
  93.             this.draw3dBorder(_loc11_,_loc12_,_loc7_,_loc13_,_loc14_,_loc10_);
  94.          }
  95.          else if(_loc5_ == "outset")
  96.          {
  97.             this._color = this.colorList;
  98.             this.draw3dBorder(_loc11_,_loc7_,_loc12_,_loc14_,_loc13_,_loc10_);
  99.          }
  100.          else if(_loc5_ == "alert")
  101.          {
  102.             var _loc15_ = this.getStyle("themeColor");
  103.             this.drawRoundRect(0,5,_loc3_,_loc4_ - 5,5,6184542,10);
  104.             this.drawRoundRect(1,4,_loc3_ - 2,_loc4_ - 5,4,[6184542,6184542],10,0,"radial");
  105.             this.drawRoundRect(2,0,_loc3_ - 4,_loc4_ - 2,3,[0,14342874],100,0,"radial");
  106.             this.drawRoundRect(2,0,_loc3_ - 4,_loc4_ - 2,3,_loc15_,50);
  107.             this.drawRoundRect(3,1,_loc3_ - 6,_loc4_ - 4,2,16777215,100);
  108.          }
  109.          else if(_loc5_ == "default")
  110.          {
  111.             this.drawRoundRect(0,5,_loc3_,_loc4_ - 5,{tl:5,tr:5,br:0,bl:0},6184542,10);
  112.             this.drawRoundRect(1,4,_loc3_ - 2,_loc4_ - 5,{tl:4,tr:4,br:0,bl:0},[6184542,6184542],10,0,"radial");
  113.             this.drawRoundRect(2,0,_loc3_ - 4,_loc4_ - 2,{tl:3,tr:3,br:0,bl:0},[12897484,11844796],100,0,"radial");
  114.             this.drawRoundRect(3,1,_loc3_ - 6,_loc4_ - 4,{tl:2,tr:2,br:0,bl:0},16777215,100);
  115.          }
  116.          else if(_loc5_ == "dropDown")
  117.          {
  118.             this.drawRoundRect(0,0,_loc3_ + 1,_loc4_,{tl:4,tr:0,br:0,bl:4},[13290186,7895160],100,-10,"linear");
  119.             this.drawRoundRect(1,1,_loc3_ - 1,_loc4_ - 2,{tl:3,tr:0,br:0,bl:3},16777215,100);
  120.          }
  121.          else if(_loc5_ == "menuBorder")
  122.          {
  123.             _loc15_ = this.getStyle("themeColor");
  124.             this.drawRoundRect(4,4,_loc3_ - 2,_loc4_ - 3,0,[6184542,6184542],10,0,"radial");
  125.             this.drawRoundRect(4,4,_loc3_ - 1,_loc4_ - 2,0,6184542,10);
  126.             this.drawRoundRect(0,0,_loc3_ + 1,_loc4_,0,[0,14342874],100,250,"linear");
  127.             this.drawRoundRect(0,0,_loc3_ + 1,_loc4_,0,_loc15_,50);
  128.             this.drawRoundRect(2,2,_loc3_ - 3,_loc4_ - 4,0,16777215,100);
  129.          }
  130.          else if(_loc5_ != "comboNonEdit")
  131.          {
  132.             this.beginFill(_loc7_);
  133.             this.drawRect(0,0,_loc3_,_loc4_);
  134.             this.drawRect(1,1,_loc3_ - 1,_loc4_ - 1);
  135.             this.endFill();
  136.             this._color = this.borderColorName;
  137.          }
  138.       }
  139.       if(_loc8_ != undefined)
  140.       {
  141.          this.beginFill(_loc8_);
  142.          this.drawRect(_loc9_,_loc9_,this.__get__width() - _loc9_,this.__get__height() - _loc9_);
  143.          this.endFill();
  144.       }
  145.    }
  146.    function draw3dBorder(c1, c2, c3, c4, c5, c6)
  147.    {
  148.       var _loc3_ = this.__get__width();
  149.       var _loc2_ = this.__get__height();
  150.       this.beginFill(c1);
  151.       this.drawRect(0,0,_loc3_,_loc2_);
  152.       this.drawRect(1,0,_loc3_ - 1,_loc2_);
  153.       this.endFill();
  154.       this.beginFill(c2);
  155.       this.drawRect(1,0,_loc3_ - 1,1);
  156.       this.endFill();
  157.       this.beginFill(c3);
  158.       this.drawRect(1,_loc2_ - 1,_loc3_ - 1,_loc2_);
  159.       this.endFill();
  160.       this.beginFill(c4);
  161.       this.drawRect(1,1,_loc3_ - 1,2);
  162.       this.endFill();
  163.       this.beginFill(c5);
  164.       this.drawRect(1,_loc2_ - 2,_loc3_ - 1,_loc2_ - 1);
  165.       this.endFill();
  166.       this.beginFill(c6);
  167.       this.drawRect(1,2,_loc3_ - 1,_loc2_ - 2);
  168.       this.drawRect(2,2,_loc3_ - 2,_loc2_ - 2);
  169.       this.endFill();
  170.    }
  171.    static function classConstruct()
  172.    {
  173.       mx.core.ext.UIObjectExtensions.Extensions();
  174.       _global.styles.rectBorderClass = mx.skins.halo.RectBorder;
  175.       _global.skinRegistry.RectBorder = true;
  176.       return true;
  177.    }
  178. }
  179.